import { connect, Helmet } from 'umi';
import { BaseLayoutInfo } from './type'
import { useEffect } from 'react'

import styles from './index.less';

function Layout({children,routes,route,location,menuList,dispatch}){
    useEffect(() => {
        dispatch({
            type: 'menu/getMenuList'
        })
    },[])
    useEffect(() => {
        console.log('menuList',menuList)
    },[menuList])
    return (
        <>
            <Helmet>
                <title>这是一个标题</title>
            </Helmet>
            <div className={styles.container}>
                <div className={styles.left}>左侧边栏</div>
                <div className="right">右侧内容{menuList[0]?.name}</div>
            </div>
        </>
    )
}

export default connect(({menu}) => {
    return ({
        menuList: menu?.menuList
    })
})(Layout)